package com.zhp.fs.controller;

import com.zhp.fs.base.BaseController;
import com.zhp.fs.pojo.entity.UserEntity;
import com.zhp.fs.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;

/**
 * 说明：
 * <p>
 * 作者： fwj
 * <p>
 * 时间： 2017/7/29  9:44
 */
@Controller
@RequestMapping(value = "user")
public class UserController extends BaseController {
    @Resource
    private UserService userService;

    @RequestMapping(value = "adduser",method = RequestMethod.POST)
    @ResponseBody
    public Object addUser(UserEntity userEntity) {
        int addResult = userService.addUser(userEntity);
        if (addResult == 1) {
            return rsMap.setSuccessCode();
        } else {
            return rsMap.setCode(1);
        }
    }
}
